package com.scn.base.dao.impl;

import java.util.ArrayList;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import com.scn.base.dao.SysMenuDao;
import com.scn.base.domain.MenuVO;


public class SysMenuDaoImpl extends SqlMapClientDaoSupport implements SysMenuDao{

	public List selectMenu() {
		List list = new ArrayList();
		list = getSqlMapClientTemplate().queryForList("selectMenuList");
		if(list != null && list.size() > 0){
			return list;
		}else{
		    return null;
		}
	}

	public List selectRolePowerList(int srid) {
		List list = new ArrayList();
		list = getSqlMapClientTemplate().queryForList("selectRolePowerList",srid);
		if(list != null && list.size() > 0){
			return list;
		}else{
		    return null;
		}
	}

	public List selectRolePower(int srid) {
		List list = new ArrayList();
		list = getSqlMapClientTemplate().queryForList("selectRolePower",srid);
		if(list != null && list.size() > 0){
			return list;
		}else{
		    return null;
		}
	}

	public List<MenuVO> selectMenuAll() {
		List<MenuVO> list = getSqlMapClientTemplate().queryForList("selectMenuAll");
		return list;
	}

	public int checkMenuName(String smname) {
		int count =(Integer)getSqlMapClientTemplate().queryForObject("checkMenuName",smname);
		return count;
	}

	public void insertMenu(MenuVO menu) {
		getSqlMapClientTemplate().insert("insertMenu", menu);
	}

	public Object selectMaxIdByPid(String pid) {
		return getSqlMapClientTemplate().queryForObject("selectMaxIdByPid",pid);
	}

}
